package com.ciwong.epaper.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ExpandableListView;

/**
 * Created by res-yinxue on 2016/7/11.
 */
public class NoScrollExpandableListView extends ExpandableListView {
    private boolean isScroll = true;

    public NoScrollExpandableListView(Context context) {
        super(context);
    }

    public NoScrollExpandableListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NoScrollExpandableListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        return super.onInterceptTouchEvent(event) && isScroll;
    }

    public void setScroll(boolean isScroll)
    {
        this.isScroll = isScroll;
    }

}
